﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CategoryEdit.ascx.cs"
    Inherits="HUGATE.Item.Controls.Category.CategoryEdit" %>
<%@ Register Src="ParentCategory.ascx" TagName="ParentCategory" TagPrefix="uc1" %>
<asp:UpdatePanel ID="udpEdit" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <table border="0" cellpadding="2" cellspacing="0" style="width: 100%">
            <tr id="trID" runat="server">
                <td>
                    <%=HUGATE.Utility.ResxManager.GetString("ID") + HUGATE.Utility.ResxManager.GetString("ITEMCategory") + ":" %>
                    <asp:HiddenField ID="hdfCatID" runat="server" />
                </td>
                <td>
                    <asp:TextBox ID="txtObjectID" runat="server" ValidationGroup="checkDataInput" 
                        Width="150px" MaxLength="100"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtObjectID"
                        ErrorMessage="*" ForeColor="Red" ValidationGroup="checkDataInput" Enabled="false"></asp:RequiredFieldValidator>
                    <asp:CheckBox ID="chkAutoGen" runat="server" Text="Tự động sinh" onclick="EnDisableIDText(this);" />
                </td>
            </tr>
            <tr>
                <td style="width: 150px">
                    <%=HUGATE.Utility.ResxManager.GetString("Name") + HUGATE.Utility.ResxManager.GetString("ITEMCategory") + ":"%>
                </td>
                <td>
                    <asp:TextBox ID="txtObjectName" runat="server" MaxLength="200" ValidationGroup="checkDataInput"
                        Width="280px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtObjectName"
                        ErrorMessage="*" ValidationGroup="checkDataInput" ForeColor="Red"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <%=HUGATE.Utility.ResxManager.GetString("OfParentCategoryID") + ":"%>
                </td>
                <td>
                    <asp:UpdatePanel ID="Upnsel" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:TextBox ID="txtparentID" runat="server" Width="148px" ReadOnly="True" />
                            <asp:HiddenField ID="hdfParentID" runat="server" />
                                <asp:Button ID="btnChooseCategory" runat="server" CssClass="Control_ButtonBrowse"
                        Text="..." onclick="btnChooseCategory_Click" />
                            <asp:Panel ID="pnsel" runat="server" CssClass="Popup_Table" Style="display: none;
                                width: 310px">
                                <div class="Popup_Title">
                                    <table border="0" cellpadding="0" cellspacing="0" class="Popup_Title" style="width: 100%">
                                        <tbody>
                                            <tr>
                                                <td>
                                                    <strong>
                                                        <asp:Label ID="lblTitle2" runat="server"></asp:Label>
                                                    </strong>
                                                </td>
                                                <td align="center" style="padding-right: 2px; width: 20px">
                                                    <div class="Popup_BtClose" style="width: 17px; height: 17px; text-align: center">
                                                        <asp:LinkButton ID="lnkClose" runat="server" CssClass="Popup_BtClose" Height="17px"
                                                            Width="17px" OnClick="lnkClose_Click"></asp:LinkButton>
                                                    </div>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="Popup_Content">
                                    <div style="width: 300px; height: 500px; overflow-y: scroll;">
                                        <uc1:ParentCategory ID="ctrlparent" runat="server"></uc1:ParentCategory>
                                    </div>
                                </div>
                                <div id="divcontrol" runat="server">
                                </div>
                                <ajaxToolkit:ModalPopupExtender ID="mpesel" runat="server" PopupControlID="pnsel"
                                    TargetControlID="divcontrol" BackgroundCssClass="ModalPopupBackground">
                                </ajaxToolkit:ModalPopupExtender>
                            </asp:Panel>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td>
                    <%=HUGATE.Utility.ResxManager.GetString("Description")+":" %>
                </td>
                <td valign="top">
                    <asp:TextBox ID="txtDesc" runat="server" Height="100px" MaxLength="2000" onkeyup="return ismaxlength(this)"
                        TextMode="MultiLine" Width="280px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td valign="top">
                    <asp:CheckBox ID="chkIsDefault" runat="server" /><%=HUGATE.Utility.ResxManager.GetString("Default") %>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td valign="top">
                    <asp:CheckBox ID="chkIsActived" runat="server" AutoPostBack="true" OnCheckedChanged="chkIsActived_CheckedChanged" /><%=HUGATE.Utility.ResxManager.GetString("Actived") %>
                </td>
            </tr>
            <tr>
                <td style="height: 28px">
                </td>
                <td style="height: 28px">
                    <asp:Button ID="btnUpdate" runat="server" CssClass="Control_Button1" OnClick="btnUpdate_Click"
                        ValidationGroup="checkDataInput" />
                    <asp:Button ID="btnCancel" runat="server" CssClass="Control_Button1" OnClick="btnCancel_Click" />
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
    function EnDisableIDText(ctl) {
        document.getElementById('<%=txtObjectID.ClientID %>').disabled = ctl.checked ? 'disabled' : '';
        document.getElementById('<%=txtObjectID.ClientID %>').value = '';
    }
</script>